PATH![]() |
![]() ![]() |
Zooms a window in accordance with human interface guidelines.
pascal OSStatus ZoomWindowIdeal (
WindowPtr window,
SInt16 partCode,
Point *ioIdealSize);
Applications should use the ZoomWindowIdeal function instead of the older function ZoomWindow . When your application calls ZoomWindowIdeal , it automatically conforms to the human interface guidelines for determining a window's standard state, as described in Window Zooming .
The ZoomWindowIdeal function calculates a window's ideal standard state and updates a window's ideal user state independently of the WStateData structure. Previously, the window definition function was responsible for updating the user state, but because it relies upon the WStateData structure, the window definition function is unaware of the ideal standard state and can no longer track the window's zoom state reliably.
While the Window Manager is reliably aware of the window's zoom state, it cannot record the current user state in the WStateData structure, because the window definition function can overwrite that data. Therefore, if your application uses ZoomWindowIdeal , the WStateData structure is superseded, and the result of the FindWindow function should be ignored when determining whether a particular user click of the zoom box is a request to zoom in or out. When you adopt ZoomWindowIdeal and your application receives a result of either inZoomIn or inZoomOut from FindWindow , your application must use the function IsWindowInStandardState and code such as that in Listing 2-9 in Zooming a Window Gracefully to determine the appropriate part code to pass in the partCode parameter.